layui.use(['form', 'table'], function () {
    let $ = layui.jquery,
        table = layui.table;


    console.log(console.log($(this).attr('data-type')))
    $(".data-count-edit").click(function () {

        let title='';
        if(parseInt($(this).attr('data-type'))==1){
            title='服务协议';
        }else{
            title='隐私协议';
        }
        let index = layer.open({
            title: '编辑'+title,
            type: 2,
            shade: 0.2,
            maxmin: true,
            shadeClose: true,
            area: ['80%', '80%'],
            content: '/admin/Apply/SaveAgr?type='+$(this).attr('data-type'),
        });
        $(window).on("resize", function () {
            layer.full(index);
        });
    });

    table.on('tool(currentTableFilter)', function (obj) {
        var data = obj.data;

        if (obj.event === 'edit') {

            var index = layer.open({
                title: '编辑 升级参数',
                type: 2,
                shade: 0.2,
                maxmin: true,
                shadeClose: true,
                area: ['80%', '80%'],
                content: '/admin/Industry/Savelevels?id='+obj.data.id,
            });
            $(window).on("resize", function () {
                layer.full(index);
            });
            return false;
        }
    });

});